package com.wwl.cms.utils.designModeTest.decorator;

/**
 * @author wwl
 * @version 1.0
 * @date 2021/9/7 18:09
 * @description:
 */
public class Decorator extends Drink {
    private Drink obj;
    public Decorator(Drink obj){//组合
        this.obj= obj;
    }

    @Override
    public float cost(){
        return super.getPrice()+obj.cost();
    }
    @Override
    public String getDes(){
        return des+""+getPrice()+"&&"+obj.getDes();
    }

}
